#include <stdio.h>
#include <stdlib.h>
#include <strings.h>

typedef struct _slist
{
    int index;
    struct _slist *next;
}slist;


slist* new_node() 
{
    slist *node = malloc(sizeof(slist));
    if (node) {
        bzero(node, sizeof(slist));
    }

    return node;
}

int main()
{
    slist *head = NULL;
    slist *tail = NULL;
    int data_set[] = {100, 3, 2, 3, 4, 5};
    for (int i = 0; i < sizeof(data_set)/sizeof(data_set[0]); i++) {
        slist *node = new_node();
        if (!head) {
            head = node;
        }
        
        if (tail) {
            tail->next = node;
        }

        node->index = data_set[i];
        tail = node;
    }

    for (slist *node = head; node; node = node->next) {
        printf("index %d\n", node->index);
    }
}